/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Paralelos;

import Conexao.Gerenciador;
import java.util.concurrent.ExecutorService;
import java.util.logging.Level;
import java.util.logging.Logger;


public class Observador implements Runnable {

    private ExecutorService exec;
    private Gerenciador gerenciador;
    private boolean done;

    public Observador(ExecutorService apps, Gerenciador ger) {

        this.exec = apps;
        this.gerenciador = ger;
        done = false;
    }

    public void run ()
    {
        while(!done)
        {
            try {
                Thread.sleep(900000);
                gerenciador.verificar_fluxos();
            } catch (InterruptedException ex) {
                Logger.getLogger(Observador.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
    }

    public void done ()
    {
        done = true;
    }
}
